package org.zjx.task.core;

import lombok.Data;

/**
 * 任务执行结果
 */
@Data
public class TaskResult {
    private final boolean success;
    private final String message;
    private final String taskId;
    private final long executionTime;
    private final int retryCount;

    /**
     * 构造任务结果
     * @param success 任务是否成功
     * @param message 结果消息
     * @param taskId 任务ID
     * @param retryCount 重试次数
     */
    public TaskResult(boolean success, String message, String taskId, int retryCount) {
        this.success = success;
        this.message = message;
        this.taskId = taskId;
        this.retryCount = retryCount;
        this.executionTime = System.currentTimeMillis();
    }

    /**
     * 简化版构造函数
     * @param success 任务是否成功
     * @param message 结果消息
     */
    public TaskResult(boolean success, String message) {
        this(success, message, null, 0);
    }
}